<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../../global/css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./frm.css?time={$time}" />
    <style>
        /* app内，不显示跳到下载app的链接 */
        a[href*="/views/down/index.html"],
        a[href*="://a.app.qq.com/o/simple.jsp"] {
            display: none;
        }
    </style>
</head>
<body>

<div class="main aui-content" id="main"></div>

<div id="aliPay-submit" class="aliPay-submit aui-hide"></div>

<div id="wxPay-submit" class="wxPay-submit aui-hide"></div>

</body>

<script id="tpl-aliPay-dialog" type="text/x-dot-template">

    <div class="aliPay-submit-container">
        <div style="height: 0.5rem; visibility: hidden; display: block;"></div>
        <div class="aliPay-title">提现到支付宝</div>
        <div class="aliPay-content">
            {{? it.isBindAliPay != 1 }}
            <div class="input-wrapper">
                <input id="aliPay-account" placeholder="支付宝账号" />
            </div>
            <div class="input-wrapper">
                <input id="aliPay-realName" placeholder="真实姓名" />
            </div>
            <div class="get-code-desc">
                <div>* 第一次提现需要绑定您的支付宝账号以及真实姓名，姓名与账号不相符会导致提现失败。</div>
            </div>
            {{?}}
            <div>
                <div class="get-code-container input-wrapper">
                    <input id="aliPay-code" placeholder="验证码" />
                    <div onclick="requestPhoneCode(this);" tapmode id="get-code-btn">获取验证码</div>
                </div>
                <div class="get-code-desc">
                    <span>* 提现操作需要向您的手机号码</span>
                    <span>{{=it.phone}}</span>
                    <span>发送验证码</span>
                    <div>
                        <span>* 提现代表您已同意</span><a href="#" tapmode onclick="openPrivacy();">{{=it.privacy.Title}}</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="aliPay-actions">
            <div onclick="aliPaySubmitAction()" tapmode class="aliPay-submit-btn">提交</div>
            <div onclick="hideAliPayDialog()" tapmode class="aliPay-cancel-btn">取消</div>
        </div>
        <div style="height: 1.0rem; visibility: hidden; display: block;"></div>
    </div>

</script>

<script id="tpl-wxPay-dialog" type="text/x-dot-template">

    <div class="wxPay-submit-container">
        <div style="height: 0.5rem; visibility: hidden; display: block;"></div>
        <div class="wxPay-title">提现到微信</div>
        <div class="wxPay-content">
            {{? it.isBindWxPay != 1 }}
            <div class="wxPay-third-auth">
                <div class="third_auth" tapmode onclick="wxLogin()">
            </div>
            <div class="get-code-desc">
                <div>* 第一次提现需要绑定您的微信账号,请先点击微信图标进行绑定。</div>
            </div>
            {{?}}
            <div>
                <div class="get-code-container input-wrapper">
                    <input id="wxPay-code" placeholder="验证码" />
                    <div onclick="requestPhoneCode(this);" tapmode id="get-wx-code-btn">获取验证码</div>
                </div>
                <div class="get-code-desc">
                    <span>* 提现操作需要向您的手机号码</span>
                    <span>{{=it.phone}}</span>
                    <span>发送验证码</span>
                    <div>
                        <span>* 提现代表您已同意</span><a href="#" tapmode onclick="openPrivacy();">{{=it.privacy.Title}}</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="wxPay-actions">
            <div onclick="wxPaySubmitAction()" tapmode class="wxPay-submit-btn">提交</div>
            <div onclick="hideWxPayDialog()" tapmode class="wxPay-cancel-btn">取消</div>
        </div>
        <div style="height: 1.0rem; visibility: hidden; display: block;"></div>
    </div>

</script>

<script id="tpl-draw-info" type="text/x-dot-template">

    <div class="content">

        <div class="draw-price-wrapper">
            <div class="balance-container">
                <div class="balance-title">当前余额：</div>
                <div class="balance-unit">¥&nbsp;</div>
                <div class="balance">{{=it.Amount}}</div>
            </div>
            <div class="draw-cash-container">
                <div class="draw-cash-title">当前可提现金额：</div>
                <div class="draw-cash-unit">¥&nbsp;</div>
                <div class="draw-cash">{{=it.Cash}}</div>
            </div>
            <div id="balance-tip" class="balance-tip aui-hide">当前余额不足，无法提现</div>
            <div id="draw-money-select" class="draw-money-select">
                {{~it.CashItems :v:i}}
                <div tapmode onclick="moneySelect(this);" data-index="{{=i}}" class="draw-money-item {{=(v.Warning == '') ? '': 'disabled'}}">
                    <div class="item-wrapper">
                        <div class="unit">¥&nbsp;</div>
                        <div class="money">{{=v.Amount}}</div>
                    </div>
                </div>
                {{~}}
            </div>
        </div>

        <div id="pay-select-wrapper" class="pay-select-wrapper">
            {{~it.PayWays :v:i}}
                <div tapmode onclick="payTypeSelect(this);" data-index="{{=i}}" class="pay-select">
                    <div class="select-icon"></div>
                    <img class="select-type" src="{{=v.Icon}}">
                    <div class="pay-type-name">{{=v.Subject}}</div>
                </div>
            {{~}}
        </div>

        <div class="pay-desc">
            {{~it.Details :v:i}}
            <div class="desc-p">
                <div>{{=v.Title}}</div>
                {{~v.Content :item:j}}
                <div>{{=item}}</div>
                {{~}}
            </div>
            {{~}}
        </div>

        <div class="draw-btn-container">
            <div id="draw-btn" class="draw-btn" tapmode onclick="drawAction()">确认提现:¥ 0.0</div>
        </div>

    </div>

</script>

<script type="text/javascript" src="../../../config.js?time={$time}"></script>
<script type="text/javascript" src="../../../global/script/lib/api.js?time={$time}"></script>
<script type="text/javascript" src="../../../global/script/lib/doT.min.js"></script>
<script type="text/javascript" src="../../../global/script/lib/zepto.min.js"></script>
<script type="text/javascript" src="../../../global/script/lib/aui-lazyload.js"></script>
<script type="text/javascript" src="../../../global/script/mylib.js?time={$time}"></script>
<script type="text/javascript" src="../../../app.js?time={$time}"></script>
<script type="text/javascript" src="./frm.js?time={$time}"></script>

</html>


<script type="text/javascript" src="../../../global/script/_fakeApi.js"></script>

<script>

    function hasPhone() {
        return true;
    }

    bindPhone = '17665140903';
    // apiready();

    drawCashInfo = {
	    "Amount": "1.05",
	    "Cash": "2.08",
        "CashItems": [
            {
                Amount:"1",
                Warning: "xxx",
                Day: 2,
            },
            {
                Amount:"1",
                Warning: "xxx",
                Day: 2,
            },
            {
                Amount:"20000",
                Warning: "xxx",
                Day: 10,
            },
        ],
        "PayWays": [{
		    "Subject": "支付宝",
		    "Icon": "../../../global/image/wallet/pay-zfb.png",
		    "Status": 0,
		    "PayWay": 1
	    }],
	    "Details": [{
		    "Title": "提现兑换说明",
		    "Content": ["1）1元提现需要连续登录5天", "2）5元提现需要连续登录10天", "3）10元提现需要连续登录20天"]
	    }, {
		    "Title": "注意事项",
		    "Content": ["1.提现申请将在一个工作日后到审批到账，请在新等待"]
	    }]
    };

    renderInfo();

    var dom = $api.byId('aliPay-submit');
    var html = doT_Render('#tpl-aliPay-dialog', {
        phone: '136****5601',
        isBindAliPay: 0,
        privacy: {
            Title:"《隐私政策》"
        }
    });
    dom.innerHTML = html;
    sofast();
    $api.removeCls(dom, 'aui-hide');

</script>
